package com.yingda.ad;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.yingda.activity.BaseActivity;
import com.yingda.activity.ExcelActivity;
import com.yingda.activity.ExcelNewActivity;
import com.yingda.activity.MessgeReadActivity;
import com.yingda.adapter.SwichAdapter;

import java.util.ArrayList;
import java.util.List;

public class SplishActivity  extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splish_layout);
        RecyclerView rv =  findViewById(R.id.rv);
        List<String> list = new ArrayList<>();
        list.add("表格的功能");
        list.add("读取短信信息");

        SwichAdapter swichAdapter = new SwichAdapter(this,list);
        swichAdapter.setOnClickListener(pos -> {
            switch (pos){
                case 0:
                   // Intent intent = new Intent(this, ExcelActivity.class);
                    Intent intent = new Intent(this, ExcelNewActivity.class);
                    startActivity(intent);
                    break;
                case 1:

                    Intent intent1 = new Intent(this, MessgeReadActivity.class);
                    startActivity(intent1);
                    break;
            }
        });
        rv.setLayoutManager(new LinearLayoutManager(this));
        rv.setAdapter(swichAdapter);
    }
}
